package com.streamsets.datacollector.model.etl.bean;

import java.util.List;

/**
 * 字段类型转换 的对象实体Bean
 * /*
 *      * 需要传的字段包括：
 *      *   fields：一个数组，包括多个字段
 *      * 所以只需要传fields和targetType(如DATETIME、DATE),
 *      *      dateFormat（如：YYYY_MM_DD_HH_MM_SS、YYYY_MM_DD、DD_MM_YYYY、YYYY_MM_DD_HH_MM_SS_SSS、YYYY_MM_DD_HH_MM_SS_SSS_Z）
 *      * 对应的配置文件为
 *      * [ {
 *           "fields" : [ "/created_dt" ],
 *           "targetType" : "DATETIME",
 *           "treatInputFieldAsDate" : false,
 *           "dataLocale" : "en,US",
 *           "scale" : -1,
 *           "decimalScaleRoundingStrategy" : "ROUND_UNNECESSARY",
 *           "dateFormat" : "YYYY_MM_DD_HH_MM_SS",
 *           "zonedDateTimeFormat" : "ISO_ZONED_DATE_TIME",
 *           "encoding" : "UTF-8"
 *         }, {
 *           "fields" : [ "/updated_dt" ],
 *           "targetType" : "DATETIME",
 *           "treatInputFieldAsDate" : false,
 *           "dataLocale" : "en,US",
 *           "scale" : -1,
 *           "decimalScaleRoundingStrategy" : "ROUND_UNNECESSARY",
 *           "dateFormat" : "YYYY_MM_DD_HH_MM_SS",
 *           "zonedDateTimeFormat" : "ISO_ZONED_DATE_TIME",
 *           "encoding" : "UTF-8"
 *         } ]
 * @author wengzhonghui
 * @date 2020/4/2 11:26
 */
public class FieldTypeConversionBean {

    // 【必须】需要类型转换的字段
     private List<String> fields;

     //【必须】 需要转换的目标数据类型，包括：BOOLEAN、CHAR、BYTE、SHORT、INTEGER、LONG、FLOAT、DOUBLE、DECIMAL、STRING
     private String targetType = "String";

    //【必须】时间格式,包括：YYYY_MM_DD_HH_MM_SS、YYYY_MM_DD、DD_MM_YYYY、YYYY_MM_DD_HH_MM_SS_SSS、YYYY_MM_DD_HH_MM_SS_SSS_Z
    private String dateFormat = "YYYY_MM_DD_HH_MM_SS";

    private Boolean treatInputFieldAsDate = false;

    private String dataLocale = "zh,CN";

    private Integer scale = -1;

    private String decimalScaleRoundingStrategy = "ROUND_UNNECESSARY";

    private String zonedDateTimeFormat = "ISO_ZONED_DATE_TIME";

    private String encoding = "UTF-8";


    public List<String> getFields() {
        return fields;
    }

    public void setFields(List<String> fields) {
        this.fields = fields;
    }

    public String getTargetType() {
        return targetType;
    }

    public void setTargetType(String targetType) {
        this.targetType = targetType;
    }

    public String getDateFormat() {
        return dateFormat;
    }

    public void setDateFormat(String dateFormat) {
        this.dateFormat = dateFormat;
    }

    public Boolean getTreatInputFieldAsDate() {
        return treatInputFieldAsDate;
    }

    public void setTreatInputFieldAsDate(Boolean treatInputFieldAsDate) {
        this.treatInputFieldAsDate = treatInputFieldAsDate;
    }

    public String getDataLocale() {
        return dataLocale;
    }

    public void setDataLocale(String dataLocale) {
        this.dataLocale = dataLocale;
    }

    public Integer getScale() {
        return scale;
    }

    public void setScale(Integer scale) {
        this.scale = scale;
    }

    public String getDecimalScaleRoundingStrategy() {
        return decimalScaleRoundingStrategy;
    }

    public void setDecimalScaleRoundingStrategy(String decimalScaleRoundingStrategy) {
        this.decimalScaleRoundingStrategy = decimalScaleRoundingStrategy;
    }

    public String getZonedDateTimeFormat() {
        return zonedDateTimeFormat;
    }

    public void setZonedDateTimeFormat(String zonedDateTimeFormat) {
        this.zonedDateTimeFormat = zonedDateTimeFormat;
    }

    public String getEncoding() {
        return encoding;
    }

    public void setEncoding(String encoding) {
        this.encoding = encoding;
    }
}
